<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 把对象转化为 参数数据队列
    var data = {
        user: "a123123",
        pwd: "123123",
        phone: "17386141517",
        email: "1272071495@qq.com"
    }

    // user=a123123&pwd=123123&phone=17386141516&email=1272071495@qq.com

    var str = "";
    for (var key in data) {
        // key   "user" "pwd"
        // val   data[key]
        var val = data[key];
        str += key + "=" + val + "&";
    }
    console.log(str);  //  user=a123123&pwd=123123&phone=17386141516&email=1272071495@qq.com&

    data = str.substring(0, str.length - 1);
    console.log(data);  // user=a123123&pwd=123123&phone=17386141516&email=1272071495@qq.com
</script>

</html>